package cn.tedu.submarine;
//点项目名称右键，New一个Directory，起名img，将图片粘贴进去
import javax.swing.ImageIcon;
/** 图片类 */
public class Images {
//  公开的  静态的  图片数据类型  变量名
    public static ImageIcon   sea;        //海洋图片
    public static ImageIcon   gameover;   //游戏结束图片
    public static ImageIcon   battleship; //战舰图片
    public static ImageIcon   obsersubm;  //侦察潜艇图片
    public static ImageIcon   torpesubm;  //鱼雷潜艇图片
    public static ImageIcon   minesubm;   //水雷潜艇图片
    public static ImageIcon   mine;       //水雷图片
    public static ImageIcon   bomb;       //炸弹图片

    static{ //初始静态图片
        sea = new ImageIcon("img/sea.png"); //将img下的sea.png读取到静态变量sea中
        gameover = new ImageIcon("img/gameover.png");
        battleship = new ImageIcon("img/battleship.png");
        obsersubm = new ImageIcon("img/obsersubm.png");
        torpesubm = new ImageIcon("img/torpesubm.png");
        minesubm = new ImageIcon("img/minesubm.png");
        mine = new ImageIcon("img/mine.png");
        bomb = new ImageIcon("img/bomb.png");
    }

    public static void main(String[] args) { //只测试图片
        //getImageLoadStatus()返回8表示图片读取成功，返回其它数据表示图片读取失败
        System.out.println(sea.getImageLoadStatus());
        System.out.println(gameover.getImageLoadStatus());
        System.out.println(battleship.getImageLoadStatus());
        System.out.println(obsersubm.getImageLoadStatus());
        System.out.println(torpesubm.getImageLoadStatus());
        System.out.println(minesubm.getImageLoadStatus());
        System.out.println(mine.getImageLoadStatus());
        System.out.println(bomb.getImageLoadStatus());
    }

}
















